$(".btnsend").click(function(){
	var type=$("#type").val();
	var usersId=$("#usersId").val();
	var title=$("#title").val();
	var templete=$("#templete").val();
	var relevance=$("#relevance").val();
	var relevanceId=$("#relevanceId").val();
	$.ajax({
			url:'http://web.icecn.net/internal/message/sendMessage.json',
			type:'POST',
			async:true,
			data:{
				type:type,
				usersId:usersId,
				title:title,
				templete:templete,
				relevance:relevance,
				relevanceId:relevanceId
			},
			xhrFields:{withCredentials:true},
			dataType: "json",
			success: function(data){
				if(data.code === 200 ){
					alert("发送成功")
				}else{
					alert("发送失败")
			    }
			}
	   });
})
$("#type").change(function(){
	if($(this).val()=="0"){
		$("#usersId").attr("disabled",true)
		$("#usersId").val("")
	}else{
		$("#usersId").attr("disabled",false)
		$("#usersId").val("")
	}
})